﻿

function lasso()
{
    this.StartPoint = new point(); 
    this.CurrentPoint = new point();
    this.StartValue = 0.0;
    this.on = false;
    
}

lasso.prototype.d = function ()
{
    var x = this.StartPoint.X- this.CurrentPoint.X;
    var y = this.StartPoint.Y- this.CurrentPoint.Y;
    
    return Math.sqrt(x*x + y*y);
}

lasso.prototype.dx = function ()
{
    return this.StartPoint.X- this.CurrentPoint.X;
}

lasso.prototype.dy = function ()
{
    return this.StartPoint.Y- this.CurrentPoint.Y;
}
    
lasso.prototype.getMouseXY = function getMouseXY(P) 
{
    P.X = event.clientX + document.body.scrollLeft;
    P.Y = event.clientY + document.body.scrollTop;
} 
  
function point()
{
    this.X=0;
    this.Y=0;
}

function point(x,y)
{
    this.X=x;
    this.Y=y;
}

